package com.shop.domain.user;

import java.util.Date;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.*;
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * <p>UserLevel 实体类</p>
 * <p>Table: t_user_level - 用户等级记录表</p>
 * @author generator
 * @date 2021-03-08 08:01:02
 */
@ApiModel("UserLevel 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_user_level")
@SQLDelete(sql = "update t_user_level set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class UserLevel extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 用户uid
	 */
    @ApiModelProperty("用户uid")
	@Column(name = "uid")
    private Long uid;

    /**
	 * 等级vip
	 */
    @ApiModelProperty("等级vip")
	@Column(name = "level_id")
    private Long levelId;

    /**
	 * 会员等级
	 */
    @ApiModelProperty("会员等级")
	@Column(name = "grade")
    private int grade;

    /**
	 * 过期时间
	 */
    @ApiModelProperty("过期时间")
	@Column(name = "valid_time")
    private Date validTime;

    /**
	 * 是否永久
	 */
    @ApiModelProperty("是否永久")
	@Column(name = "is_forever")
    private Integer isForever;

    /**
	 * 商户id
	 */
    @ApiModelProperty("商户id")
	@Column(name = "mer_id")
    private Integer merId;

    /**
	 * 0:禁止,1:正常
	 */
    @ApiModelProperty("0:禁止,1:正常")
	@Column(name = "status")
    private Integer status;

    /**
	 * 备注
	 */
    @ApiModelProperty("备注")
	@Column(name = "mark")
    private String mark;

    /**
	 * 是否已通知
	 */
    @ApiModelProperty("是否已通知")
	@Column(name = "remind")
    private Integer remind;

    /**
	 * 添加时间
	 */
    @ApiModelProperty("添加时间")
	@Column(name = "create_time")
    private Date createTime;

    /**
	 * 享受折扣
	 */
    @ApiModelProperty("享受折扣")
	@Column(name = "discount")
    private Integer discount;

    /**
	 * 修改时间
	 */
    @ApiModelProperty("修改时间")
	@Column(name = "update_time")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
	 * 是否删除
	 */
    @ApiModelProperty("是否删除")
	@Column(name = "is_deleted")
    @JSONField(serialize=false)
    private Integer isDeleted;
}